package cn.lysj.framework.foodv2.repository;

import cn.lysj.framework.base.BaseRepository;
import cn.lysj.framework.common.utils.web.SelectItem;
import cn.lysj.framework.foodv2.domain.FoodType;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author drj
 * @description 菜品品类数据处理层
 * @create 2018-11-09 11:21:07
 **/
public interface FoodTypeRepository extends BaseRepository<FoodType> {



    List<FoodType> findByStoreIdOrderByRankDesc(String storeId);

    FoodType findByStoreIdAndNameAndDelFlag(String storeId,String name,Integer delFlag);

    @Query(value = "SELECT NEW  cn.lysj.framework.common.utils.web.SelectItem(a.id,a.name) FROM FoodType a  where a.storeId = ?1 ")
    List<SelectItem> findFoodType(String storeId);

}